function endsWith(str, suffix) {
    return str.indexOf(suffix, str.length - suffix.length) !== -1;
}

$(document).ready(function () {
    $('.blog-article-content .article-content-image').each(function () {
        var imageUrl = $(this).attr('src');
        //var rel = null;
        //if (endsWith(imageUrl, '!detail')) {
        //    rel = imageUrl.substring(0, imageUrl.indexOf('!detail'));
        //}
        //if (rel) {
        //    $(this).attr('data-rel', rel);
        //}
        $(this).wrap('<figure data-am-widget="figure" class="am am-figure" data-am-figure="{pureview:true}"></figure>');
    });
});